package com.onec.service.api.enums;

import java.io.Serializable;

/**
 * payment 服务状态设计
 *
 * @author ONEC
 */
public enum ResultCodeEnum implements IResultCode, Serializable {

    /**
     * 成功
     */
    SUCCESS(10000, "成功"),
    /**
     * 失败
     */
    FAILED(20000, "失败"),
    /**
     * 处理中
     */
    DOING(30000, "处理中"),
    /**
     * 拒绝访问
     */
    UNAUTHORIZED(4003, "拒绝访问,没有对应的权限！"),
    /**
     * 接口不存在
     */
    NOT_FOUND(4004, "请求路径不存在，或者服务已下线，请稍后重试！"),
    /**
     * 缺少token
     */
    NO_TOKEN(4005, "认证失败，缺少头部token值"),
    /**
     * 缺少token
     */
    USERNAME_OR_PASSWORD_ERROR(4006, "用户名或者密码错误！"),
    /**
     * 缺少token
     */
    USER_ACCESS_UNAUTHORIZED(4007, "请求未授权！"),

    USER_ACCESS_LOCK(4008, "token有误或已过期！"),

    USER_ACCESS_RETRY(4009, "请重新获取token值！"),

    CLIENT_ACCESS_ERROR(4010, "客户端信息验证失败！"),

    RPC_NO_PROVIDE(4011, "无可用RPC服务！"),
    CLIENT_LOCK(4012, "该用户已锁定！"),
    CLIENT_LOGIN_EXPIRE(4013, "登录次数超过限制！"),
    CLIENT_REDIS_LOCK_FAILED(4014, "获取锁失败！"),

    /**
     * 服务器内部错误
     */
    SERVER_ERROR(5000, "系统服务异常，请稍后重试！");

    private Integer code;

    private String message;

    @Override
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
